<%@ page language="java" import="java.util.*, java.text.*,com.zjut.alipay.util.*,com.zjut.alipay.config.*,com.zjut.an.util.tools.*,com.zjut.an.util.system.*,com.zjut.zs.util.tools.*,
com.zjut.zs.pay.dao.*, com.zjut.zs.pay.manager.*,com.zjut.zs.userstatus.manager.*, com.zjut.zs.userstatus.dao.*,
com.zjut.zs.user.manager.*, com.zjut.zs.user.dao.*,
java.io.*,net.sf.json.*" pageEncoding="utf-8"%>
<%
ZsPayManager pmanager = (ZsPayManager) SpringContextUtil.getBean("ZsPayManager");
DateUtil dateutil = (DateUtil) SpringContextUtil.getBean("DateUtil");
ZsUserStatusManager zsmanager = (ZsUserStatusManager) SpringContextUtil.getBean("ZsUserStatusManager");
ZsUserManager umanager = (ZsUserManager) SpringContextUtil.getBean("ZsUserManager");

//String postdata = Common.getPostData(request.getInputStream(), request.getContentLength(), null);
System.out.println("缴费后台反馈："+request.getParameter("outTradeNo")); 
System.out.println("缴费后台反馈："+request.getParameter("key")); 
System.out.println("缴费后台反馈："+request.getParameter("orderDateTime")); 

if (null!=request.getParameter("outTradeNo")) {
	ZsPay pay = new ZsPay();
	pay.setOutTradeNo(request.getParameter("outTradeNo"));
	
    List list = pmanager.getDataByInstance(1,1,null,null,pay).getObjects();
	if (list.size()>0) {
		pay = (ZsPay)list.get(0);
		//pay.setTransactionId(trade_no);
		if (!Status.PAYSTATUS_YES.getStatus().equals(pay.getPayEnd())){
			pay.setTimeEnd(dateutil.getCurrentDate5());
			pay.setPayEnd(Status.PAYSTATUS_YES.getStatus());
			ZsUserStatus userstatus = zsmanager.getDataByUser(umanager.getData(pay.getUsId()));
			userstatus.setPayStatus(Status.PAYSTATUS_YES.getStatus());
			userstatus.setPayTime(dateutil.getCurrentDate5());
			zsmanager.updateData(userstatus);
			pmanager.updateData(pay);
			System.out.println("支付状态异步成功 ");
		} 
		response.getWriter().write("缴费成功");
	} else {
		response.getWriter().write("缴费失败");
	}			
}

%>  